package org.csu.agrisupply.api.service;

import org.csu.agrisupply.api.common.CommonResponse;
import org.csu.agrisupply.api.entity.Form;
import org.csu.agrisupply.api.entity.FormOffer;
import org.csu.agrisupply.api.vo.FormOfferVo;
import org.springframework.web.bind.annotation.*;

import java.util.List;

public interface FormOfferService {
    //得到所有报价单
    CommonResponse<List<FormOffer>> getFormOfferList();

    //得到单个报价单
    CommonResponse<FormOffer> getFormOffer(@PathVariable("id") String formId, String userId);

    //进行报价
    CommonResponse<FormOffer> createOffer(@PathVariable("id") String formId, String userId, float price, int count, String fromAddr);

    //修改报价单信息
    CommonResponse<FormOffer> updateOffer(@PathVariable("id") String formId, String userId, float price, int count, String fromAddr,int status);

    //根据userId得到所有报价单
    CommonResponse<List<FormOfferVo>> getFormOfferListbyUserId(@PathVariable("id") String userId);

    //根据formId得到所有报价单
    CommonResponse<List<FormOfferVo>> getFormOfferListbyFormId(@PathVariable("id") String formId);

    //取消对应offer
    public CommonResponse<FormOfferVo> deleteOffer(@PathVariable("id") String formId, String userId);
}
